package com.example.demo.service.impl;

import com.example.demo.annotation.RedisLock;
import com.example.demo.service.ISayHelloService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author MarioZzz
 * @create 2024-04-12 8:57
 */
@Slf4j
//同一个接口的实现类，在spring容器中必须只有一个
// 多个实现类如果都交由spring管理，
// 会报错 “expected single matching bean but found 2: sayHelloServiceImpl1,sayHelloServiceImpl2”
//@Service
public class SayHelloServiceImpl1 implements ISayHelloService {

    private String attr1;

    @Override
    //没有加入spring容器，注解失效
    @RedisLock
    public void sayHello() {
        log.info("Hello,this is SayHelloServiceImpl1===");
    }
}
